<div class="content_wrapper">

    <div class="container-fluid">
        <div class="row">
            <div class="col-sm-12">
                <aside>
                    <header><i class="fa fa-fw fa-file"></i>管理员列表</header>
                    <section>
                        <div class="container-fluid">
                            <div class="row">
                                <div class="col-sm-12">
                                    <div class="btn-group" style="margin-bottom:20px;">
                                        <button class="btn btn-default J_ajax_content_modal" data-href="./managerUser/add.html">添加</button>
                                    </div>

                                    <div class="table-responsive">
                                        <table id="manager_user_table" class="table table-striped table-bordered table-hover" cellspacing="0" width="100%">
                                            <thead>
                                            <tr>

                                                <th><input class="all_item_check" type="checkbox" value="" /></th>
                                                <th>id</th>
                                                <th>管理员账号</th>
                                                <th>手机号</th>
                                                <th>姓名</th>
                                                <th>状态</th>
                                            </tr>
                                            </thead>
                                            <tbody>

                                            </tbody>
                                        </table>
                                    </div>
                                    <nav id="pagination-hsx">

                                    </nav>
                                </div>
                            </div>
                        </div>
                    </section>
                </aside>
            </div>
        </div>
    </div>


</div>

<script>
    $(document).ready(function () {
        var page;
        var lists;
        getManagerUsersData(1);
    });

    function getManagerUsersData(pageIndex) {
        $.ajax({
            type: 'post',
            url: common_conf.requestUrl+'managerUser/list',
            contentType : 'application/json;charset=UTF-8',
            cache: false,
            data: '{"pageIndex":'+pageIndex+'}',
            dataType: 'json',
            beforeSend: function () {
            },
            success: function (returnData) {
                if(forceLogin(returnData)) return;
                var obj=returnData;
                if(obj.state=="success"){
                    var values=Array();
                    $.each(obj.list,function(index,user){
                        val=Array();
                        val[0]=user.id;
                        val[1]=user.username;
                        val[2]=user.phone;
                        val[3]=user.name;
                        val[4]=user.state==1 ? "正常" : "非正常";
                        values.push(val);
                    });
                    initTable("#manager_user_table",values,"./#managerUser/edit.html");
                    page=obj.page;
                    lists=values;
                    paginate(page,"pagination-hsx");
                    clickBind(page,"getManagerUsersData");

                }else{
                    alert("获取失败");
                }
            },
            error: function () {
                alert("未找到模板");
            }
        });
    }



</script>